#ifndef DOOR_FSM_HPP
#define DOOR_FSM_HPP

#include <tinyfsm.hpp>

// 定义事件
struct OpenDoor : tinyfsm::Event {};
struct CloseDoor : tinyfsm::Event {};

// 定义状态
struct DoorState : tinyfsm::Fsm<DoorState> {
  virtual void entry() {}
  virtual void react(tinyfsm::Event const &) {}
  virtual void exit() {}  // 添加 exit 方法的空实现
};

struct DoorClosed : DoorState {
  void entry() override;
  void react(tinyfsm::Event const &) override;
};

struct DoorOpened : DoorState {
  void entry() override;
  void react(tinyfsm::Event const &) override;
};

using DoorFSM = tinyfsm::FsmList<DoorClosed, DoorOpened>;

#endif  // DOOR_FSM_HPP
